/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ke.me.muhia.mvn.app.main;

import ke.me.muhia.mvn.app.ucip.UCIPParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 * @author Kenneth
 */
public class WorkerServer implements Runnable{
    private static final Logger logger = LoggerFactory.getLogger(WorkerServer.class); 
    UCIPParams params = null;
    String name = "";
    
    public WorkerServer(){
        
    }
    
    public WorkerServer(String name){
        this.name = name;
    }

    @Override
    public void run() {
        try {
            ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"AppConfig.xml"});
            //Inititiate the parameters required
            params = (UCIPParams) context.getBean(name);
            
        } catch (Exception e) {
            logger.error("WorkerServer.Run", e);
        }
    }
    
    
}
